#pragma once
#ifndef GLOBAL_PARA_DEBUG
#define GLOBAL_PARA_DEBUG
#include "TStyle.h"
#include <string> 
#include <vector>
#include "yaml-cpp/yaml.h"

#include "src/Lib/MessageFormat.h"
#include "src/Function/Fbasic.h"
#include "src/RWpara/RWbasic.h"
#include "src/Function/Ffastjet.h"
#include "src/Function/Fvector.h"
#include "src/Function/Froot.h"
#include "src/Function/FTLorentzVector.h"


class CDebug{
	private:
	public:
		bool   mode;

		int    num_debug_mode;
		int    level;
		std::vector<bool> debug;
		void Read_Debug(CPath path);

		template <class TMess_single>
			void Message_single(TMess_single t)
			{
				std::cout << t << " " ;
			}

		template <typename TMess1, typename... TMess4> 
			void Message(int itlevel, int itpos, TMess1 mess, TMess4... ddata4){
    			if(!mode){
    				return;
    			}
    			if(itpos>=num_debug_mode) {
    				std::cout<< "wrong itpos number in debug message" << std::endl;
    			}
    			if ((itlevel<level && debug[itpos])|| debug[0])   {
				std::cout.setf(std::ios::left);
				std::string fill="debug ";
				std::string fill_inc="     ";

				int  fillnum_inc=5;
				int  fillnum=0;
				for(int i=0;i<itlevel;i++){
					fill+=fill_inc;
					fillnum+=fillnum_inc;
				}

				std::cout << fill << std::setw(60-fillnum) << std::setfill(' ') << mess << " :    " ;
				int arr[] = {(Message_single(ddata4), 0)...};
				std::cout << std::endl;
    			}
			}


//  template <typename TDebug1, typename TDebug2> 
//  		void Message(int itlevel, int itpos, std::string mess, TDebug1 ddata, TDebug2 ddata2){
//  			if(!mode){return;}
//  			if(itpos>=num_debug_mode) {std::cout<< "wrong itpos number in debug message" << std::endl;}
//  			if ((itlevel<level && debug[itpos])|| debug[0])   
//  			{
//  				ShowMessage(itlevel,"debugging  ",mess,ddata,ddata2);
//  			}
//  			//					std::cout << "debugging : " << mess  << "   " << ddata << "  " << ddata2 << std::endl;
//  		}
//  	template <typename TDebug> 
//  		void Message(int itlevel, int itpos, std::string mess, TDebug ddata){
//  			if(!mode){
//  				return;
//  			}
//  			if(itpos>=num_debug_mode) {
//  				std::cout<< "wrong itpos number in debug message" << std::endl;
//  			}
//  			if ((itlevel<level && debug[itpos])|| debug[0])   {
//  				ShowMessage(itlevel,"debugging  ",mess,ddata);
//  			}
//  			//std::cout << "debugging : " << mess  << "   " << ddata << std::endl;
//  		}
//  
//  	void Message(int itlevel, int itpos,std::string mess){
//  		if(!mode){
//  			return;
//  		}
//  		if(itpos>=num_debug_mode) {
//  			std::cout<< "wrong itpos number in debug message" << std::endl;
//  		}
//  		if ((itlevel<level && debug[itpos])|| debug[0])  {
//  			ShowMessage(itlevel,"debugging  ",mess);
//  		}
//  		//std::cout << "debugging:  " << mess  << std::endl;
//  	}
};

#endif
